//
//  PzCoinTypeBtn.swift
//  Pz
import Foundation
import SnapKit
class PzCoinTypeBtn: UIButton {
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.setImage(UIImage(named: "pzCoinNoSelect"), for: .normal)
        self.setImage(UIImage(named: "pzCoinSelect"), for: .selected)
        self.titleLabel?.font = UIFont.systemFont(ofSize: 30.fitScale(), weight: .regular)
        self.setTitleColor(UIColor(hex:0x333333), for: .normal)
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func layoutSubviews() {
        super.layoutSubviews()
                        
        imageView?.snp.makeConstraints { make in
            make.left.equalTo(0.fitScale())
            make.centerY.equalToSuperview()
            make.width.equalTo(32.fitScale())
            make.height.equalTo(32.fitScale())
        }
        titleLabel?.snp.makeConstraints { make in
            make.left.equalTo(imageView!.snp.right).offset(4.fitScale())
            make.right.equalTo(0.fitScale())
            make.centerY.equalTo(imageView!)
            make.height.equalTo(36.fitScale())
        }
    }
}
